package com.apollographql.apollo.internal.fetcher;

import com.apollographql.apollo.api.internal.ApolloLogger;
import com.apollographql.apollo.fetcher.ResponseFetcher;
import com.apollographql.apollo.interceptor.ApolloInterceptor;
import com.apollographql.apollo.interceptor.ApolloInterceptorChain;
import java.util.concurrent.Executor;

public final class NetworkOnlyFetcher implements ResponseFetcher {
    @Override // com.apollographql.apollo.fetcher.ResponseFetcher
    public ApolloInterceptor provideInterceptor(ApolloLogger apolloLogger) {
        return new NetworkOnlyInterceptor();
    }

    private static final class NetworkOnlyInterceptor implements ApolloInterceptor {
        private NetworkOnlyInterceptor() {
        }

        @Override // com.apollographql.apollo.interceptor.ApolloInterceptor
        public void interceptAsync(InterceptorRequest request, ApolloInterceptorChain chain, Executor dispatcher, CallBack callBack) {
            chain.proceedAsync(request.toBuilder().fetchFromCache(false).build(), dispatcher, callBack);
        }

        @Override // com.apollographql.apollo.interceptor.ApolloInterceptor
        public void dispose() {
        }
    }
}
